package com.alex.ioc.relation;

import com.alex.ioc.autowire.Address;
import com.alex.ioc.autowire.Person;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class RelationApplicationTest {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("relation.xml");

        System.out.println((Address) ctx.getBean("address1"));
        System.out.println((Address) ctx.getBean("address2"));
        System.out.println((Address) ctx.getBean("address3"));
//        System.out.println((Address) ctx.getBean("address"));
        System.out.println((Address) ctx.getBean("address4"));

        System.out.println((Person) ctx.getBean("person1"));
    }
}
